package
{
	import flash.display.Sprite;
	
	public class UserFighter implements IFGFighter 
	{

		private var xVel:int;
		private var yVel:int;
		private var weapon:IFGWeapon;
		private var s:Sprite;
		private static var TYPE:int = 1;
		private static var HEIGHT:int = 20;
		private static var WIDTH:int = 20;
		private static var COLOR:uint = 0x0000FF;
		
		public function UserFighter(xPosition:int, yPosition:int, xVelocity:int, yVelocity:int, startWeapon:IFGWeapon)
		{
			xVel = xVelocity;
			yVel = yVelocity;
			this.weapon = startWeapon;
			s = new Sprite();
			s.graphics.beginFill(COLOR);
			s.x = xPosition;
			s.y = yPosition;
			s.graphics.drawRect(0, 0, WIDTH, HEIGHT);
		}
		
		public function setXVel(xVelocity:int):void {
			xVel = xVelocity;
		}
		
		public function setYVel(yVelocity:int):void {
			yVel = yVelocity;
		}
		
		public function getXVel():int {
			return xVel;
		}
		
		public function getYVel():int {
			return yVel;
		}
		
		public function getXPos():int {
			return s.x;
		}
		
		public function getYPos():int {
			return s.y;
		}
		
		public function getHeight():int {
			return HEIGHT;
		}
		
		public function getWidth():int {
			return WIDTH;
		}
		
		public function getColor():uint {
			return COLOR;
		}
		
		public function move():void {
			s.x += xVel; 
			s.y += yVel;
		}
		
		public function shoot():IFGPiece {
			var i:IFGPiece = weapon.shoot(s.x, s.y, s.width, TYPE);
			return i;
		}
		
		public function getSprite():Sprite {
			return s;
		}
		
		public function destroy():void {
			
		}
		
		public function getType():int {
			return TYPE;
		}
		
	}
}